<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
MapMaker (Guava: Google Core Libraries for Java - r08)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="MapMaker (Guava: Google Core Libraries for Java - r08)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../com/google/common/collect/MapEvictionListener.html" title="interface in com.google.common.collect"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../com/google/common/collect/Maps.html" title="class in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html?com/google/common/collect/MapMaker.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MapMaker.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.google.common.collect</FONT>
<BR>
Class MapMaker</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../com/google/common/collect/GenericMapMaker.html" title="class in com.google.common.collect">com.google.common.collect.GenericMapMaker</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&gt;
      <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.google.common.collect.MapMaker</B>
</PRE>
<HR>
<DL>
<DT><PRE><FONT SIZE="-1"><A HREF="../../../../com/google/common/annotations/GwtCompatible.html" title="annotation in com.google.common.annotations">@GwtCompatible</A>(<A HREF="../../../../com/google/common/annotations/GwtCompatible.html#emulated()">emulated</A>=true)
</FONT>public final class <B>MapMaker</B><DT>extends <A HREF="../../../../com/google/common/collect/GenericMapMaker.html" title="class in com.google.common.collect">GenericMapMaker</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&gt;</DL>
</PRE>

<P>
<p>A <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/ConcurrentMap.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>ConcurrentMap</CODE></A> builder, providing any combination of these
 features: <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/ref/SoftReference.html?is-external=true" title="class or interface in java.lang.ref">soft</A> or <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/ref/WeakReference.html?is-external=true" title="class or interface in java.lang.ref">weak</A> keys, soft or weak values, size-based evicition, timed expiration, and
 on-demand computation of values. Usage example: <pre>   <code>ConcurrentMap&lt;Key, Graph&gt; graphs = new MapMaker()
       .concurrencyLevel(4)
       .softKeys()
       .weakValues()
       .maximumSize(10000)
       .expireAfterWrite(10, TimeUnit.MINUTES)
       .makeComputingMap(
           new Function&lt;Key, Graph&gt;() {
             public Graph apply(Key key) {
               return createExpensiveGraph(key);
             }
           });</code></pre>

 These features are all optional; <code>new MapMaker().makeMap()</code>
 returns a valid concurrent map that behaves exactly like a
 <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/ConcurrentHashMap.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>ConcurrentHashMap</CODE></A>.

 The returned map is implemented as a hash table with similar performance
 characteristics to <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/ConcurrentHashMap.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>ConcurrentHashMap</CODE></A>. It supports all optional
 operations of the <code>ConcurrentMap</code> interface. It does not permit
 null keys or values.

 <p><b>Note:</b> by default, the returned map uses equality comparisons
 (the <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang"><CODE>equals</CODE></A> method) to determine equality
 for keys or values. However, if <A HREF="../../../../com/google/common/collect/MapMaker.html#weakKeys()"><CODE>weakKeys()</CODE></A> or <A HREF="../../../../com/google/common/collect/MapMaker.html#softKeys()"><CODE>softKeys()</CODE></A> was specified, the map uses identity (<code>==</code>)
 comparisons instead for keys. Likewise, if <A HREF="../../../../com/google/common/collect/MapMaker.html#weakValues()"><CODE>weakValues()</CODE></A> or
 <A HREF="../../../../com/google/common/collect/MapMaker.html#softValues()"><CODE>softValues()</CODE></A> was specified, the map uses identity comparisons
 for values.

 <p>The returned map has <i>weakly consistent iteration</i>: an iterator
 over one of the map's view collections may reflect some, all or none of
 the changes made to the map after the iterator was created.

 <p>An entry whose key or value is reclaimed by the garbage collector
 immediately disappears from the map. (If the default settings of strong
 keys and strong values are used, this will never happen.) The client can
 never observe a partially-reclaimed entry. Any <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util"><CODE>Map.Entry</CODE></A>
 instance retrieved from the map's <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#entrySet()" title="class or interface in java.util">entry set</A>
 is a snapshot of that entry's state at the time of retrieval; such entries
 do, however, support <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true#setValue(V)" title="class or interface in java.util"><CODE>Map.Entry.setValue(V)</CODE></A>.

 <p>The maps produced by <code>MapMaker</code> are serializable, and the
 deserialized maps retain all the configuration properties of the original
 map. If the map uses soft or weak references, the entries will be
 reconstructed as they were, but there is no guarantee that the entries won't
 be immediately reclaimed.

 <p><code>new MapMaker().weakKeys().makeMap()</code> can almost always be
 used as a drop-in replacement for <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/WeakHashMap.html?is-external=true" title="class or interface in java.util"><CODE>WeakHashMap</CODE></A>, adding
 concurrency, asynchronous cleanup, identity-based equality for keys, and
 great flexibility.
<P>

<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>2 (imported from Google Collections Library)</DD>
<DT><B>Author:</B></DT>
  <DD>Bob Lee, Kevin Bourrillion</DD>
</DL>
<HR>

<P>

<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MapMaker.html#MapMaker()">MapMaker</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a new <code>MapMaker</code> instance with default settings,
 including strong keys, strong values, and no automatic expiration.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MapMaker.html#concurrencyLevel(int)">concurrencyLevel</A></B>(int&nbsp;concurrencyLevel)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Guides the allowed concurrency among update operations.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;K,V&gt; <A HREF="../../../../com/google/common/collect/GenericMapMaker.html" title="class in com.google.common.collect">GenericMapMaker</A>&lt;K,V&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MapMaker.html#evictionListener(com.google.common.collect.MapEvictionListener)">evictionListener</A></B>(<A HREF="../../../../com/google/common/collect/MapEvictionListener.html" title="interface in com.google.common.collect">MapEvictionListener</A>&lt;K,V&gt;&nbsp;listener)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies a listener instance, which all maps built using this <code>MapMaker</code> will notify each time an entry is evicted.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MapMaker.html#expiration(long, java.util.concurrent.TimeUnit)">expiration</A></B>(long&nbsp;duration,
           <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</A>&nbsp;unit)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>use <A HREF="../../../../com/google/common/collect/MapMaker.html#expireAfterWrite(long, java.util.concurrent.TimeUnit)"><CODE>expireAfterWrite(long, java.util.concurrent.TimeUnit)</CODE></A>, which behaves exactly the same.
     <b>This method is scheduled for deletion in July 2012.</b></I></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MapMaker.html#expireAfterAccess(long, java.util.concurrent.TimeUnit)">expireAfterAccess</A></B>(long&nbsp;duration,
                  <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</A>&nbsp;unit)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies that each entry should be automatically removed from the
 map once a fixed duration has passed since the entry's last access.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MapMaker.html#expireAfterWrite(long, java.util.concurrent.TimeUnit)">expireAfterWrite</A></B>(long&nbsp;duration,
                 <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</A>&nbsp;unit)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies that each entry should be automatically removed from the
 map once a fixed duration has passed since the entry's creation.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MapMaker.html#initialCapacity(int)">initialCapacity</A></B>(int&nbsp;initialCapacity)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets a custom initial capacity (defaults to 16).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;K,V&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/ConcurrentMap.html?is-external=true" title="class or interface in java.util.concurrent">ConcurrentMap</A>&lt;K,V&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MapMaker.html#makeComputingMap(com.google.common.base.Function)">makeComputingMap</A></B>(<A HREF="../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;? super K,? extends V&gt;&nbsp;computingFunction)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Builds a map that supports atomic, on-demand computation of values.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;K,V&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/ConcurrentMap.html?is-external=true" title="class or interface in java.util.concurrent">ConcurrentMap</A>&lt;K,V&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MapMaker.html#makeMap()">makeMap</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Builds a map, without on-demand computation of values.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MapMaker.html#maximumSize(int)">maximumSize</A></B>(int&nbsp;size)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies the maximum number of entries the map may contain.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MapMaker.html#softKeys()">softKeys</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies that each key (not value) stored in the map should be
 wrapped in a <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/ref/SoftReference.html?is-external=true" title="class or interface in java.lang.ref"><CODE>SoftReference</CODE></A> (by default, strong references
 are used).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MapMaker.html#softValues()">softValues</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies that each value (not key) stored in the map should be
 wrapped in a <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/ref/SoftReference.html?is-external=true" title="class or interface in java.lang.ref"><CODE>SoftReference</CODE></A> (by default, strong references
 are used).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MapMaker.html#weakKeys()">weakKeys</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies that each key (not value) stored in the map should be
 wrapped in a <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/ref/WeakReference.html?is-external=true" title="class or interface in java.lang.ref"><CODE>WeakReference</CODE></A> (by default, strong references
 are used).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MapMaker.html#weakValues()">weakValues</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies that each value (not key) stored in the map should be
 wrapped in a <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/ref/WeakReference.html?is-external=true" title="class or interface in java.lang.ref"><CODE>WeakReference</CODE></A> (by default, strong references
 are used).</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="MapMaker()"><!-- --></A><H3>
MapMaker</H3>
<PRE>
public <B>MapMaker</B>()</PRE>
<DL>
<DD>Constructs a new <code>MapMaker</code> instance with default settings,
 including strong keys, strong values, and no automatic expiration.
<P>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="initialCapacity(int)"><!-- --></A><H3>
initialCapacity</H3>
<PRE>
public <A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A> <B>initialCapacity</B>(int&nbsp;initialCapacity)</PRE>
<DL>
<DD>Sets a custom initial capacity (defaults to 16). Resizing this or
 any other kind of hash table is a relatively slow operation, so,
 when possible, it is a good idea to provide estimates of expected
 table sizes.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html#initialCapacity(int)">initialCapacity</A></CODE> in class <CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html" title="class in com.google.common.collect">GenericMapMaker</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&gt;</CODE></DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if <code>initialCapacity</code> is
   negative
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if an initial capacity was already set</DL>
</DD>
</DL>
<HR>

<A NAME="maximumSize(int)"><!-- --></A><H3>
maximumSize</H3>
<PRE>
<FONT SIZE="-1"><A HREF="../../../../com/google/common/annotations/Beta.html" title="annotation in com.google.common.annotations">@Beta</A>
<A HREF="../../../../com/google/common/annotations/GwtIncompatible.html" title="annotation in com.google.common.annotations">@GwtIncompatible</A>(<A HREF="../../../../com/google/common/annotations/GwtIncompatible.html#value()">value</A>="To be supported")
</FONT>public <A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A> <B>maximumSize</B>(int&nbsp;size)</PRE>
<DL>
<DD>Specifies the maximum number of entries the map may contain. While the
 number of entries in the map is not guaranteed to grow to the maximum,
 the map will attempt to make the best use of memory without exceeding the
 maximum number of entries. As the map size grows close to the maximum,
 the map will evict entries that are less likely to be used again. For
 example, the map may evict an entry because it hasn't been used recently
 or very often.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html#maximumSize(int)">maximumSize</A></CODE> in class <CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html" title="class in com.google.common.collect">GenericMapMaker</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&gt;</CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>size</CODE> - the maximum size of the map
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if <code>size</code> is not greater than zero
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if a maximum size was already set<DT><B>Since:</B></DT>
  <DD>8</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="concurrencyLevel(int)"><!-- --></A><H3>
concurrencyLevel</H3>
<PRE>
<FONT SIZE="-1"><A HREF="../../../../com/google/common/annotations/GwtIncompatible.html" title="annotation in com.google.common.annotations">@GwtIncompatible</A>(<A HREF="../../../../com/google/common/annotations/GwtIncompatible.html#value()">value</A>="java.util.concurrent.ConcurrentHashMap concurrencyLevel")
</FONT>public <A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A> <B>concurrencyLevel</B>(int&nbsp;concurrencyLevel)</PRE>
<DL>
<DD>Guides the allowed concurrency among update operations. Used as a
 hint for internal sizing. The table is internally partitioned to try
 to permit the indicated number of concurrent updates without
 contention.  Because placement in hash tables is essentially random,
 the actual concurrency will vary. Ideally, you should choose a value
 to accommodate as many threads as will ever concurrently modify the
 table. Using a significantly higher value than you need can waste
 space and time, and a significantly lower value can lead to thread
 contention. But overestimates and underestimates within an order of
 magnitude do not usually have much noticeable impact. A value of one
 is appropriate when it is known that only one thread will modify and
 all others will only read. Defaults to 16.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html#concurrencyLevel(int)">concurrencyLevel</A></CODE> in class <CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html" title="class in com.google.common.collect">GenericMapMaker</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&gt;</CODE></DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if <code>concurrencyLevel</code> is
     nonpositive
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if a concurrency level was already set</DL>
</DD>
</DL>
<HR>

<A NAME="weakKeys()"><!-- --></A><H3>
weakKeys</H3>
<PRE>
<FONT SIZE="-1"><A HREF="../../../../com/google/common/annotations/GwtIncompatible.html" title="annotation in com.google.common.annotations">@GwtIncompatible</A>(<A HREF="../../../../com/google/common/annotations/GwtIncompatible.html#value()">value</A>="java.lang.ref.WeakReference")
</FONT>public <A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A> <B>weakKeys</B>()</PRE>
<DL>
<DD>Specifies that each key (not value) stored in the map should be
 wrapped in a <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/ref/WeakReference.html?is-external=true" title="class or interface in java.lang.ref"><CODE>WeakReference</CODE></A> (by default, strong references
 are used).

 <p><b>Note:</b> the map will use identity (<code>==</code>) comparison
 to determine equality of weak keys, which may not behave as you expect.
 For example, storing a key in the map and then attempting a lookup
 using a different but <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang"><CODE>equals</CODE></A>-equivalent
 key will always fail.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html#weakKeys()">weakKeys</A></CODE> in class <CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html" title="class in com.google.common.collect">GenericMapMaker</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&gt;</CODE></DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the key strength was already set<DT><B>See Also:</B><DD><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/ref/WeakReference.html?is-external=true" title="class or interface in java.lang.ref"><CODE>WeakReference</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="softKeys()"><!-- --></A><H3>
softKeys</H3>
<PRE>
<FONT SIZE="-1"><A HREF="../../../../com/google/common/annotations/GwtIncompatible.html" title="annotation in com.google.common.annotations">@GwtIncompatible</A>(<A HREF="../../../../com/google/common/annotations/GwtIncompatible.html#value()">value</A>="java.lang.ref.SoftReference")
</FONT>public <A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A> <B>softKeys</B>()</PRE>
<DL>
<DD>Specifies that each key (not value) stored in the map should be
 wrapped in a <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/ref/SoftReference.html?is-external=true" title="class or interface in java.lang.ref"><CODE>SoftReference</CODE></A> (by default, strong references
 are used).

 <p><b>Note:</b> the map will use identity (<code>==</code>) comparison
 to determine equality of soft keys, which may not behave as you expect.
 For example, storing a key in the map and then attempting a lookup
 using a different but <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang"><CODE>equals</CODE></A>-equivalent
 key will always fail.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html#softKeys()">softKeys</A></CODE> in class <CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html" title="class in com.google.common.collect">GenericMapMaker</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&gt;</CODE></DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the key strength was already set<DT><B>See Also:</B><DD><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/ref/SoftReference.html?is-external=true" title="class or interface in java.lang.ref"><CODE>SoftReference</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="weakValues()"><!-- --></A><H3>
weakValues</H3>
<PRE>
<FONT SIZE="-1"><A HREF="../../../../com/google/common/annotations/GwtIncompatible.html" title="annotation in com.google.common.annotations">@GwtIncompatible</A>(<A HREF="../../../../com/google/common/annotations/GwtIncompatible.html#value()">value</A>="java.lang.ref.WeakReference")
</FONT>public <A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A> <B>weakValues</B>()</PRE>
<DL>
<DD>Specifies that each value (not key) stored in the map should be
 wrapped in a <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/ref/WeakReference.html?is-external=true" title="class or interface in java.lang.ref"><CODE>WeakReference</CODE></A> (by default, strong references
 are used).

 <p>Weak values will be garbage collected once they are weakly
 reachable. This makes them a poor candidate for caching; consider
 <A HREF="../../../../com/google/common/collect/MapMaker.html#softValues()"><CODE>softValues()</CODE></A> instead.

 <p><b>Note:</b> the map will use identity (<code>==</code>) comparison
 to determine equality of weak values. This will notably impact
 the behavior of <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#containsValue(java.lang.Object)" title="class or interface in java.util"><CODE>containsValue</CODE></A>,
 <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/ConcurrentMap.html?is-external=true#remove(java.lang.Object, java.lang.Object)" title="class or interface in java.util.concurrent"><CODE>remove(Object, Object)</CODE></A>,
 and <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/ConcurrentMap.html?is-external=true#replace(K, V, V)" title="class or interface in java.util.concurrent"><CODE>replace(K, V, V)</CODE></A>.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html#weakValues()">weakValues</A></CODE> in class <CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html" title="class in com.google.common.collect">GenericMapMaker</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&gt;</CODE></DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the value strength was already set<DT><B>See Also:</B><DD><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/ref/WeakReference.html?is-external=true" title="class or interface in java.lang.ref"><CODE>WeakReference</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="softValues()"><!-- --></A><H3>
softValues</H3>
<PRE>
<FONT SIZE="-1"><A HREF="../../../../com/google/common/annotations/GwtIncompatible.html" title="annotation in com.google.common.annotations">@GwtIncompatible</A>(<A HREF="../../../../com/google/common/annotations/GwtIncompatible.html#value()">value</A>="java.lang.ref.SoftReference")
</FONT>public <A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A> <B>softValues</B>()</PRE>
<DL>
<DD>Specifies that each value (not key) stored in the map should be
 wrapped in a <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/ref/SoftReference.html?is-external=true" title="class or interface in java.lang.ref"><CODE>SoftReference</CODE></A> (by default, strong references
 are used).

 <p>Soft values will be garbage collected in response to memory
 demand, and in a least-recently-used manner. This makes them a
 good candidate for caching.

 <p><b>Note:</b> the map will use identity (<code>==</code>) comparison
 to determine equality of soft values. This will notably impact
 the behavior of <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#containsValue(java.lang.Object)" title="class or interface in java.util"><CODE>containsValue</CODE></A>,
 <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/ConcurrentMap.html?is-external=true#remove(java.lang.Object, java.lang.Object)" title="class or interface in java.util.concurrent"><CODE>remove(Object, Object)</CODE></A>,
 and <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/ConcurrentMap.html?is-external=true#replace(K, V, V)" title="class or interface in java.util.concurrent"><CODE>replace(K, V, V)</CODE></A>.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html#softValues()">softValues</A></CODE> in class <CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html" title="class in com.google.common.collect">GenericMapMaker</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&gt;</CODE></DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the value strength was already set<DT><B>See Also:</B><DD><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/ref/SoftReference.html?is-external=true" title="class or interface in java.lang.ref"><CODE>SoftReference</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="expiration(long, java.util.concurrent.TimeUnit)"><!-- --></A><H3>
expiration</H3>
<PRE>
<FONT SIZE="-1"><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</A>
</FONT>public <A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A> <B>expiration</B>(long&nbsp;duration,
                                      <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</A>&nbsp;unit)</PRE>
<DL>
<DD><B>Deprecated.</B>&nbsp;<I>use <A HREF="../../../../com/google/common/collect/MapMaker.html#expireAfterWrite(long, java.util.concurrent.TimeUnit)"><CODE>expireAfterWrite(long, java.util.concurrent.TimeUnit)</CODE></A>, which behaves exactly the same.
     <b>This method is scheduled for deletion in July 2012.</b></I>
<P>
<DD>Old name of <A HREF="../../../../com/google/common/collect/MapMaker.html#expireAfterWrite(long, java.util.concurrent.TimeUnit)"><CODE>expireAfterWrite(long, java.util.concurrent.TimeUnit)</CODE></A>.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html#expiration(long, java.util.concurrent.TimeUnit)">expiration</A></CODE> in class <CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html" title="class in com.google.common.collect">GenericMapMaker</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&gt;</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="expireAfterWrite(long, java.util.concurrent.TimeUnit)"><!-- --></A><H3>
expireAfterWrite</H3>
<PRE>
<FONT SIZE="-1"><A HREF="../../../../com/google/common/annotations/Beta.html" title="annotation in com.google.common.annotations">@Beta</A>
</FONT>public <A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A> <B>expireAfterWrite</B>(long&nbsp;duration,
                                      <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</A>&nbsp;unit)</PRE>
<DL>
<DD>Specifies that each entry should be automatically removed from the
 map once a fixed duration has passed since the entry's creation.
 Note that changing the value of an entry will reset its expiration
 time.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html#expireAfterWrite(long, java.util.concurrent.TimeUnit)">expireAfterWrite</A></CODE> in class <CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html" title="class in com.google.common.collect">GenericMapMaker</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&gt;</CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>duration</CODE> - the length of time after an entry is created that it
     should be automatically removed<DD><CODE>unit</CODE> - the unit that <code>duration</code> is expressed in
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if <code>duration</code> is not positive, or is
     larger than one hundred years
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the time to live or time to idle was
     already set<DT><B>Since:</B></DT>
  <DD>8</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="expireAfterAccess(long, java.util.concurrent.TimeUnit)"><!-- --></A><H3>
expireAfterAccess</H3>
<PRE>
<FONT SIZE="-1"><A HREF="../../../../com/google/common/annotations/Beta.html" title="annotation in com.google.common.annotations">@Beta</A>
<A HREF="../../../../com/google/common/annotations/GwtIncompatible.html" title="annotation in com.google.common.annotations">@GwtIncompatible</A>(<A HREF="../../../../com/google/common/annotations/GwtIncompatible.html#value()">value</A>="To be supported")
</FONT>public <A HREF="../../../../com/google/common/collect/MapMaker.html" title="class in com.google.common.collect">MapMaker</A> <B>expireAfterAccess</B>(long&nbsp;duration,
                                                            <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</A>&nbsp;unit)</PRE>
<DL>
<DD>Specifies that each entry should be automatically removed from the
 map once a fixed duration has passed since the entry's last access.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html#expireAfterAccess(long, java.util.concurrent.TimeUnit)">expireAfterAccess</A></CODE> in class <CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html" title="class in com.google.common.collect">GenericMapMaker</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&gt;</CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>duration</CODE> - the length of time after an entry is last accessed
     that it should be automatically removed<DD><CODE>unit</CODE> - the unit that <code>duration</code> is expressed in
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if <code>duration</code> is not positive, or is
     larger than one hundred years
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the time to idle or time to live was
     already set<DT><B>Since:</B></DT>
  <DD>8</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="evictionListener(com.google.common.collect.MapEvictionListener)"><!-- --></A><H3>
evictionListener</H3>
<PRE>
<FONT SIZE="-1"><A HREF="../../../../com/google/common/annotations/Beta.html" title="annotation in com.google.common.annotations">@Beta</A>
<A HREF="../../../../com/google/common/annotations/GwtIncompatible.html" title="annotation in com.google.common.annotations">@GwtIncompatible</A>(<A HREF="../../../../com/google/common/annotations/GwtIncompatible.html#value()">value</A>="To be supported")
</FONT>public &lt;K,V&gt; <A HREF="../../../../com/google/common/collect/GenericMapMaker.html" title="class in com.google.common.collect">GenericMapMaker</A>&lt;K,V&gt; <B>evictionListener</B>(<A HREF="../../../../com/google/common/collect/MapEvictionListener.html" title="interface in com.google.common.collect">MapEvictionListener</A>&lt;K,V&gt;&nbsp;listener)</PRE>
<DL>
<DD>Specifies a listener instance, which all maps built using this <code>MapMaker</code> will notify each time an entry is evicted.

 <p>A map built by this map maker will invoke the supplied listener after it
 evicts an entry, whether it does so due to timed expiration, exceeding the
 maximum size, or discovering that the key or value has been reclaimed by
 the garbage collector. It will invoke the listener synchronously, during
 invocations of any of that map's public methods (even read-only methods).
 The listener will <i>not</i> be invoked on manual removal.

 <p><b>Important note:</b> Instead of returning <em>this</em> as a <code>MapMaker</code> instance, this method returns <code>GenericMapMaker&lt;K, V&gt;</code>.
 From this point on, either the original reference or the returned
 reference may be used to complete configuration and build the map, but only
 the "generic" one is type-safe. That is, it will properly prevent you from
 building maps whose key or value types are incompatible with the types
 accepted by the listener already provided; the <code>MapMaker</code> type cannot
 do this. For best results, simply use the standard method-chaining idiom,
 as illustrated in the documentation at top, configuring a <code>MapMaker</code>
 and building your <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util"><CODE>Map</CODE></A> all in a single statement.

 <p><b>Warning:</b> if you ignore the above advice, and use this <code>MapMaker</code> to build maps whose key or value types are incompatible with the
 listener, you will likely experience a <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang"><CODE>ClassCastException</CODE></A> at an
 undefined point in the future.
<P>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if an eviction listener was already set<DT><B>Since:</B></DT>
  <DD>7</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="makeMap()"><!-- --></A><H3>
makeMap</H3>
<PRE>
public &lt;K,V&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/ConcurrentMap.html?is-external=true" title="class or interface in java.util.concurrent">ConcurrentMap</A>&lt;K,V&gt; <B>makeMap</B>()</PRE>
<DL>
<DD>Builds a map, without on-demand computation of values. This method
 does not alter the state of this <code>MapMaker</code> instance, so it can be
 invoked again to create multiple independent maps.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html#makeMap()">makeMap</A></CODE> in class <CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html" title="class in com.google.common.collect">GenericMapMaker</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&gt;</CODE></DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>a serializable concurrent map having the requested features</DL>
</DD>
</DL>
<HR>

<A NAME="makeComputingMap(com.google.common.base.Function)"><!-- --></A><H3>
makeComputingMap</H3>
<PRE>
public &lt;K,V&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/ConcurrentMap.html?is-external=true" title="class or interface in java.util.concurrent">ConcurrentMap</A>&lt;K,V&gt; <B>makeComputingMap</B>(<A HREF="../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;? super K,? extends V&gt;&nbsp;computingFunction)</PRE>
<DL>
<DD>Builds a map that supports atomic, on-demand computation of values. <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#get(java.lang.Object)" title="class or interface in java.util"><CODE>Map.get(java.lang.Object)</CODE></A> either returns an already-computed value for the given key,
 atomically computes it using the supplied function, or, if another thread
 is currently computing the value for this key, simply waits for that thread
 to finish and returns its computed value. Note that the function may be
 executed concurrently by multiple threads, but only for distinct keys.

 <p>If an entry's value has not finished computing yet, query methods
 besides <code>get</code> return immediately as if an entry doesn't exist. In
 other words, an entry isn't externally visible until the value's
 computation completes.

 <p><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#get(java.lang.Object)" title="class or interface in java.util"><CODE>Map.get(java.lang.Object)</CODE></A> on the returned map will never return <code>null</code>. It
 may throw:

 <ul>
 <li><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang"><CODE>NullPointerException</CODE></A> if the key is null or the computing
     function returns null
 <li><A HREF="../../../../com/google/common/collect/ComputationException.html" title="class in com.google.common.collect"><CODE>ComputationException</CODE></A> if an exception was thrown by the
     computing function. If that exception is already of type <A HREF="../../../../com/google/common/collect/ComputationException.html" title="class in com.google.common.collect"><CODE>ComputationException</CODE></A> it is propagated directly; otherwise it is
     wrapped.
 </ul>

 <p><b>Note:</b> Callers of <code>get</code> <i>must</i> ensure that the key
 argument is of type <code>K</code>. The <code>get</code> method accepts <code>Object</code>, so the key type is not checked at compile time. Passing an object
 of a type other than <code>K</code> can result in that object being unsafely
 passed to the computing function as type <code>K</code>, and unsafely stored in
 the map.

 <p>If <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#put(K, V)" title="class or interface in java.util"><CODE>Map.put(K, V)</CODE></A> is called before a computation completes, other
 threads waiting on the computation will wake up and return the stored
 value.

 <p>This method does not alter the state of this <code>MapMaker</code> instance,
 so it can be invoked again to create multiple independent maps.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html#makeComputingMap(com.google.common.base.Function)">makeComputingMap</A></CODE> in class <CODE><A HREF="../../../../com/google/common/collect/GenericMapMaker.html" title="class in com.google.common.collect">GenericMapMaker</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&gt;</CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>computingFunction</CODE> - the function used to compute new values
<DT><B>Returns:</B><DD>a serializable concurrent map having the requested features</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../com/google/common/collect/MapEvictionListener.html" title="interface in com.google.common.collect"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../com/google/common/collect/Maps.html" title="class in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html?com/google/common/collect/MapMaker.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MapMaker.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>

</BODY>
</HTML>
